<script lang="ts" setup>
    import {reactive, ref} from "vue";

    let Person1=ref({name:"爱上hxd",age:66});
    let Person2=reactive({name:"最爱hxd",age:55});
    function changeName(){
        Person1.value.name="不爱hxd";
    }
    function changeAge(){
        Person2.name="不爱hxd";
    }
</script>

<template>
    <h2>Person1:{{ Person1.name }}{{ Person1.age }}</h2>
    <h2>Person2:{{ Person2.name }}{{ Person2.age }}</h2>
    <button @click="changeName">更改Person1名字</button>
    <button @click="changeAge">更改Person2名字</button>
</template>

<style scoped>

</style>